import time

from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.common.by import By

# 指定自动化插件路径
driver = webdriver.Chrome(service=Service('./chromedriver.exe'))
# 控制打开网页
driver.get('https://www.baidu.com/')
input_msg = driver.find_element(By.ID, 'chat-textarea')
input_msg.clear()
input_msg.send_keys('你好哈哈哈哈哈哈哈哈哈哈哈哈')
input_msg = driver.find_element(By.ID, 'chat-submit-button')
input_msg.click()
time.sleep(5)
driver.quit()
